<p>The various options for debugging memory are now enabled in
the <code>apr_general.h</code> header file in APR. The various options are
enabled by uncommenting the define for the option you wish to
use. The section of the code currently looks like this
(<em>contained in srclib/apr/include/apr_pools.h</em>)</p>
<div class="example"><p><code>
/*<br />
#define ALLOC_DEBUG<br />
#define POOL_DEBUG<br />
#define ALLOC_USE_MALLOC<br />
#define MAKE_TABLE_PROFILE<br />
#define ALLOC_STATS<br />
*/<br />
<br />
typedef struct ap_pool_t {<br />
<span class="indent">
union block_hdr *first;<br />
union block_hdr *last;<br />
struct cleanup *cleanups;<br />
struct process_chain *subprocesses;<br />
struct ap_pool_t *sub_pools;<br />
struct ap_pool_t *sub_next;<br />
struct ap_pool_t *sub_prev;<br />
struct ap_pool_t *parent;<br />
char *free_first_avail;<br />
</span>
#ifdef ALLOC_USE_MALLOC<br />
<span class="indent">
void *allocation_list;<br />
</span>
#endif<br />
#ifdef POOL_DEBUG<br />
<span class="indent">
struct ap_pool_t *joined;<br />
</span>
#endif<br />
<span class="indent">
int (*apr_abort)(int retcode);<br />
struct datastruct *prog_data;<br />
</span>
} ap_pool_t;
</code></p></div>
<p>To enable allocation debugging simply move the <code>#define
ALLOC_DEBUG</code> above the start of the comments block and rebuild
the server.</p>
<div class="note"><h3>Note</h3>
<p>In order to use the various options the server <strong>must</strong>
be rebuilt after editing the header file.</p>
</div>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/developer/debugging.html" title="English"> en </a></p>
</div><div id="footer">
<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>